package com.example.gybicycle.common.sql;


import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CrudDao<T> {
    /**
     * 获取单条数据
     * @param id
     * @return
     */
    public T get(String id);
    public T get(Integer id);
    public T get(T entity);
    public T getByNumber(String number);
    public List<String> getQRCode(T entity);

    /**
     * 添加数据
     * @param entity
     * @return
     */
    public int insert(T entity);
    /**
     * 批量添加数据
     * @param list
     * @return
     */
    public int insertByList(List<T> list);
    public List<T> findList(T entity);

    public  String findName(Integer id);
    /**
     * 修改数据
     * @param entity
     * @return
     */
    public int update(T entity);
    public int updateByOrder(T entity);
    public int updateByList(@Param("list") List<T> list);
    /**
     * 删除数据 单条
     * @param id
     * @return
     */
    public int delete(Object id);
    public int deleteByBatch(@Param("array") List<String> ids);

    public int upByDeadLine();


    /**
     * 条件获取 总数
     * @param entity
     * @return
     */
    public Integer count(T entity);
}
